/*****************************************************************************
 * $LastChangedDate: 2011-12-13 20:56:48 -0500 (Tue, 13 Dec 2011) $
 * @file
 * @author  Jim E. Brooks  http://www.palomino3d.org
 * @brief   Mouse device class (OSG).
 *//*
 * LEGAL:   COPYRIGHT (C) 2009 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
 *****************************************************************************/

#if COMPILE_OSG
#ifndef INPUT_DEVICE_MOUSE_OSG_HH
#define INPUT_DEVICE_MOUSE_OSG_HH 1

#include "input/device_mouse.hh"

#include <osgGA/GUIEventHandler>
#include <osg/Version>

namespace input {

////////////////////////////////////////////////////////////////////////////////
/// @brief Mouse device class (OSG).
///
/// This is a private implementation of MouseDevice.
/// KeyboardDeviceOSG and MouseDeviceOG are similar.
///
class MouseDeviceOSG : public MouseDevice
{
PREVENT_COPYING(MouseDeviceOSG)
friend class MouseDevice;
private:
                    MouseDeviceOSG( void );
    virtual         ~MouseDeviceOSG();
    virtual bool    EnableDevice( void );  // implement Device abstract method

    /// @brief Handles mouse events (OSG).
    class HandlerOSG : public osgGA::GUIEventHandler
    {
    public:
                        HandlerOSG( void ) { }
        virtual         ~HandlerOSG() { }
        virtual bool    handle( const osgGA::GUIEventAdapter& event, osgGA::GUIActionAdapter& action );
#if OSG_VERSION_LESS_THAN(3,0,0)
        virtual void    accept( osgGA::GUIEventHandlerVisitor& visitor );
#endif
    };
};

} // namespace input

#endif // INPUT_DEVICE_MOUSE_OSG_HH
#endif // COMPILE_OSG
